import * as THREE from "three";
export const getBoxCenter = (mesh) => {
    let box = new THREE.Box3()
    // 包裹在包围盒中的3d对象
    box.expandByObject(mesh) 
    // 计算包围盒的中心点 - 三维坐标对象
    let center = new THREE.Vector3()
    box.getCenter(center) 
    // 计算物体的宽高深
    let size = new THREE.Vector3()
    box.getSize(size)
    return {
        center,
        size
    }
}


